<template>

  <div style="width:100%; padding:10px;">
    <p style="text-align:center; margin:auto; padding: 20px 50px 20px 0px;"> <span
        style="font-size:26px; font-weight:700;">{{this.$store.state.syste.traState.BAS001.value}}</span> <br /> <span
        style="font-size:26px; font-weight:700;">输血申请单</span> </p>
    <table style="border-collapse: collapse; width:90%; left:20px;position:relative;">
      <tr>
        <td>申请类型：<span style="font-weight:600;">{{getEnum("TraSxsqlx",item.applyType)}}</span></td>
        <td>申请单号：{{item.billNo}}</td>
        <td style="text-align:right">申请时间：{{item.creationTime}}</td>
      </tr>
    </table>
    <table style="border-collapse: collapse; width:90%; left:20px; position:relative; margin-top:10px;">
      <tr>
        <td colspan="5" style="font-weight:600; border:1px solid black; border-width:1px 0 0 0;">患者基本信息</td>
      </tr>
      <tr>
        <td>住院号/ID号：{{item.hospitalNumber}}</td>
      </tr>
      <tr>
        <td>姓名：{{item.name}}</td>
        <td>性别：{{getEnum("BasSex",item.sex)}} </td>
        <td>年龄：{{item.age}}</td>
        <td>血型：{{item.abo}} , RhD({{item.rhD}})</td>
      </tr>
      <tr>
        <td>科室：{{getBasMaterial("Department",item.basDepartmentId)}}</td>
        <td>病区：{{getBasMaterial("Department",item.dependency)}}</td>
        <td colspan="2">床号：{{item.berth}}</td>
      </tr>
      <tr>
        <td>输血史：{{getIsEnabled(item.transfuseHistory)}} </td>
        <td>输血反应史：{{getIsEnabled(item.reactionHistory)}}</td>
        <td v-if="item.sex === 0">妊娠史：{{getIsEnabled(item.gestationHistory)}} </td>
        <td v-if="item.sex === 0">分娩史：{{getIsEnabled(item.parturitionHistory)}} </td>
      </tr>
      <tr>
        <td colspan="4">临床诊断：{{item.clinicDiagnose}}</td>
      </tr>
    </table>

    <table style="border-collapse: collapse; width:90%; left:20px; position:relative; margin-top:10px;">
      <tr>
        <td colspan="4" style="font-weight:600; border:1px solid black; border-width:1px 0 0 0;">患者最近检查结果</td>
      </tr>
      <tr v-for="(li,i) in list" :key="i">
        <td v-for="(obj,j) in li" :key="j"> {{obj.code}}：{{obj.value}}{{obj.unit}} </td>
      </tr>
    </table>
    <table style="border-collapse: collapse; width:90%; left:20px; position:relative; margin-top:10px;">
      <tr>
        <td colspan="4" style="font-weight:600; border:1px solid black; border-width:1px 0 0 0;">申请血液信息</td>
      </tr>
      <tr height=50>
        <td>血液品种：<span
            style="font-size:22px; font-weight:700;">{{getBasMaterial("BloodVariety",item.basBloodVarietyId)}}</span>
        </td>
        <td>申请数量：<span
            style="font-size:22px; font-weight:700;">{{item.applySum}}{{message.bloodVarietyBy.result.unit}}</span>
        </td>
        <td>申请血型：<span style="font-size:22px; font-weight:700;">{{item.applyBloodType}},
            RhD({{item.applyRhD}})</span></td>
      </tr>
      <tr>
        <td>预定输血日期：<span style="font-weight:700;">{{item.perTranTime}}</span></td>
        <td style="display:none">不规则抗体：<span style="font-weight:600;">{{item.irregularAntibody?"是":"否"}}</span></td>
      </tr>
      <tr>
        <td>备注： </td>
        <td></td>
        <td></td>
      </tr>
    </table>
    <table style="border-collapse: collapse; width:90%; left:20px; position:relative; margin-top:10px;">
      <tr>
        <td style="border:1px solid black;border-width:1px 0 0 0;width:25%;"> 申请医生：{{getUserName(item.creatorUserId)}}
        </td>
        <td style="border:1px solid black;border-width:1px 0 0 0;width:25%;">签名： </td>
        <td style="border:1px solid black;border-width:1px 0 0 0;width:25%;">
          上级医生：{{getUserName(item.middleAuditUserId)}}</td>
        <td style="border:1px solid black;border-width:1px 0 0 0;width:25%;">签名： </td>
      </tr>
      <tr v-if="item.traSpecimenInfoId !== undefined && item.traSpecimenInfoId !== null">
        <td colspan="4" style="display:none"> 已有标本{{item.specimenCode}}，不需要采集</td>
      </tr>
    </table>
  </div>

</template>

<script>
export default {
  name: 'NursingPrint',
  methods: {
    //getBasMaterial(UserId)  //根据用户ID获取用户名
    getUserName() {
      return 'username'
    },

    getIsEnabled() {
      return '启用'
    },

    //getEnum("BasSex",id) //获取枚举名称
    getEnum() {
      return '未知'
    },

    //getBasMaterial("Department",id) //获取部门
    //getBasMaterial("BloodVariety",id) //获取血液品种名称
    //getBasMaterial("BloodVariety",id) //获取血液产品名称
    getBasMaterial() {
      return 'xxx'
    }
  },
  data: function() {
    return {
      item: {
        middleAuditUserId: 1073,
        middleAuditTime: '2020-08-04 10:39:34',
        middleAuditInfo: null,
        billNo: 'APL200804002',
        manualNo: null,
        billType: null,
        billStatus: 2,
        auditUserId: null,
        auditTime: null,
        auditInfo: '',
        applyType: 5,
        isExigence: false,
        perTranTime: '2020-08-04 13:41:14',
        creatorUserId: 915,
        creationTime: '2020-08-04 10:39:23',
        auditLevel: 1,
        traPerAppraiseBillNo: '',
        printTime: '2020年8月5日',
        dependency: '031301',
        hospitalNumber: '71656982',
        name: '赵子昂',
        abo: 'O',
        rhD: '+',
        age: '16岁',
        sex: 1,
        basDepartmentId: '031301',
        berth: '96',
        gestationHistory: 0,
        parturitionHistory: 0,
        transfuseHistory: 1,
        transplantMatchHistory: 0,
        reactionHistory: 0,
        clinicDiagnose: '急性淋巴细胞白血病',
        basBloodVarietyId: 3,
        applySum: 1,
        applyBloodType: 'O',
        specialProcessing: null,
        beforeSurgery: null,
        traAim: '预防出血',
        applyRhD: '+',
        irregularAntibody: false
      },
      name: '用血申请报告单',
      list: [
        [
          {
            unit: 'g/L',
            lisCode: '1233',
            lisName: null,
            remark: null,
            resultType: 0,
            type: 0,
            isEnabled: true,
            isRequired: false,
            id: 1,
            code: 'HGB',
            name: '血红蛋白',
            value: '116',
            creationTime: '2020-08-04 08:44:43'
          },
          {
            unit: '',
            lisCode: '250101003',
            lisName: null,
            remark: null,
            resultType: 0,
            type: 0,
            isEnabled: true,
            isRequired: false,
            id: 2,
            code: 'HCT',
            name: '红细胞压积',
            value: '0.333',
            creationTime: '2020-08-04 08:44:43'
          },
          {
            unit: '×10^9/L',
            lisCode: '1239',
            lisName: null,
            remark: null,
            resultType: 0,
            type: 0,
            isEnabled: true,
            isRequired: false,
            id: 3,
            code: 'PLT',
            name: '血小板计数',
            value: '23',
            creationTime: '2020-08-04 08:44:43'
          },
          {
            unit: null,
            lisCode: '1232',
            lisName: null,
            remark: null,
            resultType: 0,
            type: 0,
            isEnabled: true,
            isRequired: false,
            id: 13,
            code: 'RBC',
            name: '红细胞',
            value: '3.41',
            creationTime: '2020-08-04 08:44:43'
          }
        ],
        [
          {
            unit: 's',
            lisCode: '1089',
            lisName: null,
            remark: null,
            resultType: 0,
            type: 1,
            isEnabled: true,
            isRequired: false,
            id: 4,
            code: 'APTT',
            name: '活化部分凝血活酶时间',
            value: '45.4',
            creationTime: '2020-08-03 13:33:11'
          },
          {
            unit: 'g/L',
            lisCode: '1092',
            lisName: null,
            remark: null,
            resultType: 0,
            type: 1,
            isEnabled: true,
            isRequired: false,
            id: 5,
            code: 'FIB',
            name: '纤维蛋白原测定',
            value: '1.09',
            creationTime: '2020-08-03 13:33:11'
          },
          {
            unit: 's',
            lisCode: '1094',
            lisName: null,
            remark: null,
            resultType: 0,
            type: 1,
            isEnabled: true,
            isRequired: false,
            id: 6,
            code: 'TT',
            name: '凝血酶时间测定',
            value: '20.0',
            creationTime: '2020-08-03 13:33:11'
          },
          {
            unit: 's',
            lisCode: '1085',
            lisName: null,
            remark: null,
            resultType: 0,
            type: 1,
            isEnabled: true,
            isRequired: false,
            id: 7,
            code: 'PT',
            name: '凝血酶原时间测定',
            value: '13.0',
            creationTime: '2020-08-03 13:33:11'
          }
        ],
        [
          {
            unit: null,
            lisCode: '2813',
            lisName: null,
            remark: null,
            resultType: 1,
            type: 2,
            isEnabled: true,
            isRequired: true,
            id: 8,
            code: 'HBsAg',
            name: '乙肝表面抗原(HBsAg)',
            value: '0.010',
            creationTime: '2019-09-19 09:34:31'
          },
          {
            unit: null,
            lisCode: '2814',
            lisName: null,
            remark: null,
            resultType: 1,
            type: 2,
            isEnabled: true,
            isRequired: true,
            id: 11,
            code: 'HCV-Ab',
            name: '丙型肝炎病毒抗体(HCV-Ab)',
            value: '0.032',
            creationTime: '2019-09-18 19:29:39'
          },
          {
            unit: null,
            lisCode: '2811',
            lisName: null,
            remark: null,
            resultType: 1,
            type: 2,
            isEnabled: true,
            isRequired: true,
            id: 12,
            code: 'TPPA',
            name: '梅毒螺旋体抗体',
            value: '0.009',
            creationTime: '2019-09-18 19:29:39'
          },
          {
            unit: null,
            lisCode: '2810',
            lisName: null,
            remark: null,
            resultType: 1,
            type: 2,
            isEnabled: true,
            isRequired: true,
            id: 15,
            code: 'HIV',
            name: '人类免疫缺陷病毒抗体',
            value: '0.024',
            creationTime: '2019-09-18 19:29:39'
          }
        ]
      ],
      message: {
        detail: {
          billNo: 'APL200804002',
          basBloodVarietyId: 3,
          applyBloodType: 'O',
          applyRhD: '+',
          applySum: 1,
          specialProcessing: null,
          replaceBloodVarietyId: null,
          remark: null,
          beforeSurgery: null,
          otherIllustrates: null,
          isTypeReview: false,
          basSxhlx: 0,
          varietyNorm: null,
          hasSum: 1,
          traSpecimenInfoId: 105,
          basBloodVarietyName: '单采血小板'
        },
        patient: {
          irregularAntibody: false,
          billNo: 'APL200804002',
          patientId: '71656982',
          hospitalNumber: '71656982',
          name: '赵子昂',
          sex: 1,
          age: '16岁',
          birthday: '2004-05-04',
          dependency: '031301',
          apanage: 0,
          abo: 'O',
          rhD: '+',
          transfuseHistory: 1,
          reactionHistory: 0,
          gestationHistory: 0,
          parturitionHistory: 0,
          transplantMatchHistory: 0,
          basDepartmentId: '031301',
          basSingleDiseaseId: null,
          patientType1: 1,
          patientType2: 2,
          isWrittenConsent: true,
          berth: '96',
          clinicDiagnose: '急性淋巴细胞白血病',
          clinicDiagnoseCode: 'C91.000',
          traAim: '预防出血',
          result: null,
          visitId: '',
          traZyzt: 0,
          personII: '',
          admitDate: 'NaN-NaN-NaN',
          visitCount: 4,
          info1: null,
          info2: null,
          info3: null,
          info4: null,
          info5: null
        },
        master: {
          middleAuditUserId: 1073,
          middleAuditTime: '2020-08-04 10:39:34',
          middleAuditInfo: null,
          billNo: 'APL200804002',
          manualNo: null,
          billType: null,
          billStatus: 2,
          auditUserId: null,
          auditTime: null,
          auditInfo: '',
          applyType: 5,
          isExigence: false,
          perTranTime: '2020-08-04 13:41:14',
          creatorUserId: 915,
          creationTime: '2020-08-04 10:39:23',
          auditLevel: 1,
          traPerAppraiseBillNo: '',
          printTime: '2020-08-05 17:33:36'
        },
        bloodVarietyBy: {
          result: {
            id: 3,
            code: '4',
            name: '单采血小板',
            isEnabled: true,
            lastModifierUserId: 198,
            lastModificationTime: '2020-07-07 10:07:06',
            unit: '治疗量',
            isCrossMatch: false,
            basXyzl: 3,
            unitRate: 200,
            isQuantity: false,
            expirationTime: 10
          },
          targetUrl: null,
          success: true,
          error: null,
          unAuthorizedRequest: false,
          __abp: true
        }
      }
    }
  }
}
</script>
